Optimal. Leaf size=81 \[ \frac {a x}{8}-\frac {a \cos ^3(c+d x)}{3 d}+\frac {a \cos ^5(c+d x)}{5 d}+\frac {a \cos (c+d x) \sin (c+d x)}{8 d}-\frac {a \cos ^3(c+d x) \sin (c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 81, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2917, 2648,
2715, 8, 2645, 14} \begin {gather*} \frac {a \cos ^5(c+d x)}{5 d}-\frac {a \cos ^3(c+d x)}{3 d}-\frac {a \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac {a \sin (c+d x) \cos (c+d x)}{8 d}+\frac {a x}{8} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 14
Rule 2645
Rule 2648
Rule 2715
Rule 2917
Rubi steps
\begin {align*} \int \cos ^2(c+d x) \sin ^2(c+d x) (a+a \sin (c+d x)) \, dx &=a \int \cos ^2(c+d x) \sin ^2(c+d x) \, dx+a \int \cos ^2(c+d x) \sin ^3(c+d x) \, dx\\ &=-\frac {a \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {1}{4} a \int \cos ^2(c+d x) \, dx-\frac {a \text {Subst}\left (\int x^2 \left (1-x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac {a \cos (c+d x) \sin (c+d x)}{8 d}-\frac {a \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {1}{8} a \int 1 \, dx-\frac {a \text {Subst}\left (\int \left (x^2-x^4\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac {a x}{8}-\frac {a \cos ^3(c+d x)}{3 d}+\frac {a \cos ^5(c+d x)}{5 d}+\frac {a \cos (c+d x) \sin (c+d x)}{8 d}-\frac {a \cos ^3(c+d x) \sin (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.09, size = 54, normalized size = 0.67 \begin {gather*} \frac {a (60 c+60 d x-60 \cos (c+d x)-10 \cos (3 (c+d x))+6 \cos (5 (c+d x))-15 \sin (4 (c+d x)))}{480 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 77, normalized size = 0.95
method | result | size |
risch | \(\frac {a x}{8}-\frac {a \cos \left (d x +c \right )}{8 d}+\frac {a \cos \left (5 d x +5 c \right )}{80 d}-\frac {a \sin \left (4 d x +4 c \right )}{32 d}-\frac {a \cos \left (3 d x +3 c \right )}{48 d}\) | \(63\) |
derivativedivides | \(\frac {a \left (-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )+a \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{3}\left (d x +c \right )\right )}{5}-\frac {2 \left (\cos ^{3}\left (d x +c \right )\right )}{15}\right )}{d}\) | \(77\) |
default | \(\frac {a \left (-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )+a \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{3}\left (d x +c \right )\right )}{5}-\frac {2 \left (\cos ^{3}\left (d x +c \right )\right )}{15}\right )}{d}\) | \(77\) |
norman | \(\frac {\frac {a x}{8}-\frac {4 a}{15 d}-\frac {a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {3 a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {3 a \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+\frac {a \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {5 a x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {5 a x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {5 a x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {5 a x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {a x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}-\frac {4 a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {4 a \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}\) | \(220\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 52, normalized size = 0.64 \begin {gather*} \frac {32 \, {\left (3 \, \cos \left (d x + c\right )^{5} - 5 \, \cos \left (d x + c\right )^{3}\right )} a + 15 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} a}{480 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 62, normalized size = 0.77 \begin {gather*} \frac {24 \, a \cos \left (d x + c\right )^{5} - 40 \, a \cos \left (d x + c\right )^{3} + 15 \, a d x - 15 \, {\left (2 \, a \cos \left (d x + c\right )^{3} - a \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 144 vs.
\(2 (70) = 140\).
time = 0.27, size = 144, normalized size = 1.78 \begin {gather*} \begin {cases} \frac {a x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {a x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {a x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {a \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {a \sin ^{2}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{3 d} - \frac {a \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {2 a \cos ^{5}{\left (c + d x \right )}}{15 d} & \text {for}\: d \neq 0 \\x \left (a \sin {\left (c \right )} + a\right ) \sin ^{2}{\left (c \right )} \cos ^{2}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 62, normalized size = 0.77 \begin {gather*} \frac {1}{8} \, a x + \frac {a \cos \left (5 \, d x + 5 \, c\right )}{80 \, d} - \frac {a \cos \left (3 \, d x + 3 \, c\right )}{48 \, d} - \frac {a \cos \left (d x + c\right )}{8 \, d} - \frac {a \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.97, size = 198, normalized size = 2.44 \begin {gather*} \frac {a\,x}{8}+\frac {\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9}{4}-\frac {3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{2}+\left (\frac {a\,\left (150\,c+150\,d\,x-480\right )}{120}-\frac {5\,a\,\left (c+d\,x\right )}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (\frac {a\,\left (150\,c+150\,d\,x+160\right )}{120}-\frac {5\,a\,\left (c+d\,x\right )}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\frac {3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{2}+\left (\frac {a\,\left (75\,c+75\,d\,x-160\right )}{120}-\frac {5\,a\,\left (c+d\,x\right )}{8}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}+\frac {a\,\left (15\,c+15\,d\,x-32\right )}{120}-\frac {a\,\left (c+d\,x\right )}{8}}{d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________